package xyz.xmh.pattern.j2ee.compositeentitypattern;

/**
 * @author Administrator
 * <p>
 * 使用组合实体的客户端
 */
public class Client {

    private final CompositeEntity compositeEntity = new CompositeEntity();

    public void printData() {
        for (String data : compositeEntity.getData()) {
            System.out.println("data = " + data);
        }
    }

    public void setData(String data1, String data2) {
        compositeEntity.setData(data1, data2);
    }
}
